Search Results

Search: Posts Made By: f77coder
Forum: OS X (Apple) 08-31-2014
4,702
Posted By f77coder
There's an app called Disk Arbitrator, install...
There's an app called Disk Arbitrator, install it, launch it then attach drive, app will mount it low level before OSX in read-only mode.
1,593
Posted By f77coder
Maybe use perl instead, uses hash arrays use...
Maybe use perl instead, uses hash arrays use unique to remove redundant elements.
3,361
Posted By f77coder
Thanks for all the help. I'll close this thread.
Thanks for all the help. I'll close this thread.
3,361
Posted By f77coder
I don't understand the looping problem? Shouldn't...
I don't understand the looping problem? Shouldn't sed scan the array and find the value the first loop?


for i in "${array[@]}"
do
a=`grep $i sub_c11* |cut -f2 -d","`
b=`grep $i sub_c13*...
3,361
Posted By f77coder
Now when I add '-i' to do inline substitution, I...
Now when I add '-i' to do inline substitution, I still get my original error
sed -i "s/^$i.*/$i , $ratio/" sub_c18.csv
sed: 1: "sub_c18.csv": unterminated substitute pattern

Ugh...
3,361
Posted By f77coder
Where did you put the file name? I tried...
Where did you put the file name?

I tried this
sed "s/^$i.*/$i , $ratio/" <$file2mod> test0

it the script goes into an infinite loop of re-writing the file, test0.
3,361
Posted By f77coder
This is the code I used. ...
This is the code I used.

#!/usr/local/bin/bash
array=(61329025
61333750
61348174
61368157
61371144
61374807
61406775
61413072
61416814
61418304
61421223
61423127
61432337
61449549...
3,361
Posted By f77coder
I tried both and they both started looping...
I tried both and they both started looping without stopping and not substituting.

After looking closely, there is a white space after the hex number.
3,361
Posted By f77coder
This data file sub_c18.csv looks like this ...
This data file sub_c18.csv looks like this


.
.
61406774,0.553508428
61406775,a2f14cf2
61406776,0.169964852
.
.


Where 61406775,a2f14cf2 is a bad line of data to be replaced with...
3,361
Posted By f77coder
Sure. Thanks for looking. ...
Sure. Thanks for looking.


#!/usr/local/bin/bash
array=(61329025
61333750
61348174
61368157
61371144
61374807
61406775
61413072
61416814
61418304
61421223
61423127
61432337)
...
3,361
Posted By f77coder
Thanks for reply. I removed but still get...
Thanks for reply.

I removed but still get this error.

ed: 1: "sub_c18.csv": unterminated substitute pattern

From what i've read the double '//' are needed to end the wildcard???
3,361
Posted By f77coder
Thanks but that's not the issue, in my code it...
Thanks but that's not the issue, in my code it has parenthesis. I'll fix it.
3,361
Posted By f77coder
Another sed/awk search=>replace question
Hello,

Need a little bit of help. Basically I need to replace lines in a file which were calculated wrong as it would 12 hours to regenerate the data. I need to calculate values based on other...
Showing results 1 to 13 of 13

 
All times are GMT -4. The time now is 04:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy