Skip to content

How to skip lines, get the header name, and remove tabs #1453

Answered by aborruso
OpenFoam-User asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @OpenFoam-User I love the Miller documentation. It's a big project, it takes a little time and practice.

I would do it this way

<input.txt tail -n +13 | mlr --t2c clean-whitespace >output.csv

Some notes:

  • --t2c to convert from TSV to CSV
  • clean-whitespace is a verb to remove any redundant white space,

In this way you get

# Time,Cd,Cl,CmPitch
1e-05,5.961839e+03,6.112924e+00,1.461476e+03
2e-05,-2.230266e+02,2.719546e+00,-4.979762e+01
3e-05,-1.804804e+03,1.353850e-02,-4.335161e+02
4e-05,-1.573092e+01,3.288806e+00,-1.137172e+01
5e-05,1.211822e+02,1.414652e+00,3.349247e+01
6e-05,-7.082260e+01,2.963701e+00,-8.245512e+00
7e-05,-2.950213e+01,3.538622e-01,-4.937992e+00
8e-05,-1.459736e+01,3.89…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@OpenFoam-User
Comment options

@aborruso
Comment options

@OpenFoam-User
Comment options

@OpenFoam-User
Comment options

@aborruso
Comment options

Answer selected by OpenFoam-User
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants