Jul 10, 2001 #1 djrgk Programmer Jul 10, 2001 1 GB I have a large text file and need to merge every 2 lines and then insert / after a set number of characters on the new lines. The file is something like this: B afzWULod050a123456 I want it to look like this: B/a/f/zWUL/od050a/123456 Anyone any ideas?
I have a large text file and need to merge every 2 lines and then insert / after a set number of characters on the new lines. The file is something like this: B afzWULod050a123456 I want it to look like this: B/a/f/zWUL/od050a/123456 Anyone any ideas?
Jul 10, 2001 #2 Krunek Programmer Feb 14, 2001 140 HR djrgk, here is an idea: NR % 2 != 0 { first = $0 } NR % 2 == 0 { print first "/" substr($0,1,1) "/" substr($0,2,1) "/" substr($0,3,4) "/" substr($0,7,6) "/" substr($0,13) } print line must be in one line (if wrapped). Bye! KP. Upvote 0 Downvote
djrgk, here is an idea: NR % 2 != 0 { first = $0 } NR % 2 == 0 { print first "/" substr($0,1,1) "/" substr($0,2,1) "/" substr($0,3,4) "/" substr($0,7,6) "/" substr($0,13) } print line must be in one line (if wrapped). Bye! KP.