TEXTPAD DATA INSERTION EVERY nTH LINE
Posted: Thu May 18, 2006 6:34 am
I was wondering if anyone could assist please? Say I had data in the following format...
1 (id)
xxx
2
3
rrr
4
2 (id)
aaa
1
3
zzz
6
3 (id)
xxx
2
3
rrr
4
I would like to insert a "+" symbol in front of the id field [see the fields marked with (id)]. The data should look like this...
+1
xxx
2
3
rrr
4
+2
aaa
1
3
zzz
6
+3
xxx
2
3
rrr
4
As you can see from the above example, I would simply create a macro and insert a "+" at the beginning of every 7th line. No problems doing that with a macro. I use different text files that have different amounts of data. In the example above, it was every 7th line, the next file maybe every 100th line and so on. Is it possible to eneter a parameter that reflects the nth number of lines I'd like to insert a "+" symbol?
1 (id)
xxx
2
3
rrr
4
2 (id)
aaa
1
3
zzz
6
3 (id)
xxx
2
3
rrr
4
I would like to insert a "+" symbol in front of the id field [see the fields marked with (id)]. The data should look like this...
+1
xxx
2
3
rrr
4
+2
aaa
1
3
zzz
6
+3
xxx
2
3
rrr
4
As you can see from the above example, I would simply create a macro and insert a "+" at the beginning of every 7th line. No problems doing that with a macro. I use different text files that have different amounts of data. In the example above, it was every 7th line, the next file maybe every 100th line and so on. Is it possible to eneter a parameter that reflects the nth number of lines I'd like to insert a "+" symbol?