Alignment question in file
How to align and indent a file?
Hi I can indent a code in eclipse but I have a doubt for huge file which needs to be indented and aligned.The words in each line have to be specifically separated by tabs. The ideal line is like one below. All the words are seperated by tab except the last set of words ie name,id,sourceid group. Code:
POINT era parent 206 498 0.974692 + . Name=pq2.1;ID=pq2;source_id=l_Le10020385;identical_details=.;part_details=.;TWIN=pq121749.1; my file Code:
POINT era parent 206 498 0.974692 + . Name=pq2.1;ID=pq2;source_id=l_Le10020385;identical_details=.;part_details=.;TWIN=pq121749.1; Is there a way I could have them aligned like in order i previously put ? |
Code:
perl -nle 'print join "\t", split(/\s+/, $_)' < infile > outfile |
would be faster to replace \s+ with \t, but I'm not really sure it will solve all that alignment problems.
sed -r 's/\s+/\t/g' infile > outfile |
All times are GMT -5. The time now is 03:01 AM. |