Quote:
Code:
sed 's/^/s\//' $InFile1 \ |
Quote:
|
Quote:
Code:
sed 's/^/s\//' $InFile1 \ |
Quote:
now i will time it using the large datasets and see what happens. thanks alot (even if unsuccessful, at least i learned a bit more about sed). |
Quote:
Daniel B. Martin |
If you would like to keep the initial changes all sed you could try:
Code:
sed 's/\(^\|$\| \)/\//g;s/^/s/' infile > workfile |
Quote:
however i get an error like: Code:
time sed -f sed.f dataset.txt > dataset.sub edit: 100 substitutions took about 8 and 1/2 minuts. i tired with 1000 but i got the error above. (1 substitution took about 1minute 8seconds. so its not linear... its like a bulk discount) |
Quote:
500 is a guess, maybe the upper limit is a lower number. There is light at the end of this tunnel! Daniel B. Martin |
Quote:
|
Instead of split, grep and sed, maybe a simple awk can prepare your files:
Code:
awk '!(NR%500){n++}{print "s/"$1"/"$2"/g" > "workfile" n}' infile |
Quote:
Code:
# Create a test file which contains 100 lines, This is what happened. Code:
This is loop iteration # 1 Daniel B. Martin |
Quote:
Code:
awk -vWork4="$Work4" '!(NR%20) {n++}{print "s/"$1"/"$2"/g" > (Work4 n)}' $Work3 |
Quote:
This code ... Code:
# Create a test file which contains 9 lines, Code:
This is loop iteration # 1 Please advise. Daniel B. Martin |
Quote:
Code:
seq -w 9 | sed 's/$/ XXXXX/' > "$Work3" |
InFile1 ...
Code:
hello world Code:
hello my name is simon, and i like to do drawings; simon says. Code:
# In production use you would change the value of variable step to 300, 400, 500, whatever value your system can handle. In production use you would disable the echo statements which are used for explanation. Execution produced this on-screen display ... Code:
Now applying this subset of the change file... Code:
world my name is zelda, and i like to do drawings; zelda says. |
All times are GMT -5. The time now is 11:09 AM. |