Search Results

Search: Posts Made By: singerfc
4,552
Posted By singerfc
yeah I took a step back and decided to alter an...
yeah I took a step back and decided to alter an earlier step in the process, so I actually have this:

@@@one@@@:@@@field one@@@,
@@@two@@@:@@@field two@@@,
@@@three@@@:@@@he said "hello"@@@
...
4,552
Posted By singerfc
no problem, yeah I'm trying that with the bash...
no problem, yeah I'm trying that with the bash $RANDOM var for the temp file, as the operation I'm coding for could be happening often, and possibly at the same time.

thanks again, if I keep...
4,552
Posted By singerfc
I think that's it! Thank you so much! It's a...
I think that's it! Thank you so much! It's a complex line and I'm going to put the time in to understand it. One last question is how I could combine it with sed so I can have the line in a bash...
4,552
Posted By singerfc
That's nearly it, except I need the new lines to...
That's nearly it, except I need the new lines to be replaced with the explicit text '\n' in field three (so that later on, they can be replaced with <BR>). Also, do you know how I could combine that...
4,552
Posted By singerfc
That works great on that example, it doesn't...
That works great on that example, it doesn't quite work on my actual file (which I can't actually post unfortunately, without subbing the data out). If we can break down the parts I'd be grateful,...
4,552
Posted By singerfc
OK, the saga continues. I am nearly done, but...
OK, the saga continues. I am nearly done, but have this structure left, e.g.:

"one":"field one",
"two":"field two",
"three":"
field three line 1

field three line 2

field three line 3
"
...
4,552
Posted By singerfc
Found it, I just needed to add filename="$1"...
Found it, I just needed to add

filename="$1"

at the top of my bash script, then refer to $filename thereafter.

thanks again yinyuemi, and thanks for the link ctsgnb - that helped with some...
4,552
Posted By singerfc
Thanks again. That worked from the command line...
Thanks again. That worked from the command line when I added some empty single quotes after the -i. However, I'd like it to be executable from within a bash script, as it will be one stage in a...
4,552
Posted By singerfc
ah OK, I wasn't sure if it could be done in one...
ah OK, I wasn't sure if it could be done in one step.

Thanks for all your help, much appreciated.
4,552
Posted By singerfc
Yinyuemi, That's it! It was printing to...
Yinyuemi,

That's it! It was printing to stout, so I added '> outputfile.txt' at the end, and I got a new file with the text appended correctly. Is there something I can do to append the results...
4,552
Posted By singerfc
hi yinyuemi, Thanks for the help. That...
hi yinyuemi,

Thanks for the help. That script does write to line 1 so is a big help, however it bumps everything else down. I'm looking to append it to the existing line 1. Can I ask what your...
4,552
Posted By singerfc
Awk/Sed - appending within file
hello all,

First time post here. I have searched a bit but could not find an exact answer. I have about a week's experience of Sed and Awk, and am having fun, but am a little stuck.

I am...
Showing results 1 to 12 of 12

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