![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What the command to find out the record length of a fixed length file? | tranq01 | UNIX for Dummies Questions & Answers | 9 | 12-04-2008 04:04 PM |
| sed replace with fixed length | McLan | Shell Programming and Scripting | 7 | 05-15-2008 02:57 AM |
| Awk with fixed length files | c2b2 | Shell Programming and Scripting | 7 | 01-06-2007 12:57 PM |
| fixed length fields in awk | roopla | Shell Programming and Scripting | 2 | 11-13-2006 09:12 PM |
| creating a fixed length output from a variable length input | r1500 | Shell Programming and Scripting | 2 | 12-03-2003 01:09 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
fixed record length
hello!
I have a file with fixed record length... format: 123445asdfg 4343777 sfgg I wanna convert it to 123445,asdfg ,4343,777 ,sfgg is there any way to do it? sed/grep/awk?? at the moment I use sed -e 's_ \([^ ]\)_,\1_g' but it works only if there are spaces between records... any idea to deal with?? thanks for any help. |
|
||||
|
if you are sure that the no. of characters in the string is going to be constant, then you can first use sed to remove the blank spaces fron it and then use the awk substr() fn to print the required output.
Quote:
Gaurav |
|
||||
|
it doesn't solve the problem...
in each file I have to change substr parameters instead of substr($1,7,11)" ,"substr($2,1,4)","substr($2,5,7)" I want substr($the_whole_line,7,11),substr($the_whole_line,12,17) ls that possible? thanks. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|