I know how to replace a character in a file (using grep for example).
What I need to do is to replace a character in a variable :
MyVar="abcd/ter/123"
and I need to replace "/" with "_"
(in the end I want MyVar="abcd_ter_123"
It's probably soooooo easy ... but I'm stuck ...
Thank you !!!
Hello,
I searched a lot ... maybe it is just not possible.
I 'd like to be able to do a select on a table on which another traitement is doing an update.
I do no want to be 'stopped' by the lock on the row that are beeing updated.
I do not want to select the lines that are beeing updated (It's...
Thank you ... but it did not work ...
BEGIN: not found [No such file or directory]
I tried without the BEGIN, and I get the same errors as before (`{' unmatched).
A few things a tried (no success) :
1.
RDW="\x03\x32\x00\x00"
LINE="t"
echo "$RDW$LINE" > result.txt
=> adds \x03\x32\x00\x00t (all ascii) in result.txt
2.
a=`cat hexfile` (or a=$(<hexfile))
sed `s/^/"${a}";/` < test.txt > result.txt
where hexfile is a file with the hex value I need (created...
Hello,
I have a txt file like this text.txt :
Line1
Line2
Line3
I need to add X’03320000’ (as hex value) at the begining of each line (it represent the size of the line - in my case each line is the same size - which should make things easier).
Has anyone an idea ?
Thank you !
Hello,
I'm sorry to post this probably very simple question ...
I need to copy from a file into another from the line with pattern '123' to the end of the file.
I know how to do it from pattern1 to pattern2 :
awk '/pattern1/,/Pattern2/' /${File1} >> ${File2}
but I need something like
awk...
I used something like you suggested Moregelen.
FileUpload fileUpload = (FileUpload)controlCell;
HttpPostedFile myFile = fileUpload.PostedFile;
int nFileLen = myFile.ContentLength;
byte[] myData = new byte[nFileLen];
myFile.InputStream.Read(myData, 0, nFileLen)...
I searched all afternoon - found lots of post here and there ... but error still here ...
I am trying to open a file (to store it in a database).
The error occurs here
FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read);
If I run it on my machine (local), and...
Hi,
a procedure (among others ...) is executed - every 10 mins.
Sometimes (nothing special happens) - the performance decreases (usualy takes less than 1 minute -> 6 minutes).
If I recompile the procedure - it works fine again.
Does anyone has an idea what the problem can be ?
Thank you !
OK ... didn't go very far ...
I tried this :
nawk '/RapproStkMat/{sub(/.*Title XXX/,"Title XXX");sub(/\(END XXX.*/,"");print;exit}' file.txt > NewFile.txt
* awk didn't work at all, so I tried Nawk
* result : in NewFile.txt
Title XXX
=> I miss all the lines betwenn Title XXX and END XXX....
Hello,
I am not very familiar with unix. I need to copy from file A to file B, everything between line reading 'Title XXX'
to line reading 'End XXX'.
(or if it is easier from line 'Title XXX' to the end).
file A :
AAAA
BBBB
Title XXX
CCCC
DDDD
End XXX
EEEE
I need file B:
Title XXX
CCCC
DDDD...
I know you're going to tell me this is a very bad idea - but I need to save (small) text files into my SQL Server (2005) database.
But I need to do it, and do not know how ...
I will never search for text in the file or things like this.
(I may have to 'recreate' the file - that's all)
1. What...
Basically, I do not know much about unix.
I usually use the sed command.
I know for example how to delete a line containing a pattern.
But this case is a bit different and I have no idea how to start.
hello,
I have a .csv file (created by 'users'). I need to load this file in a database.
I'd like to 'prepare' the file, to avoid any problem during the load.
This is why I need to delete every line where there is nothing else than ; or spaces.
Example
a;b;c;d
;;;
; ;
;
e;f;g;h
should become ...
As you see with my question, I do not use unix script very often.
This is what i'd like to do :
I have a text file (.csv).
I want to add a few characters (";;;") at the start of each line :
test;abc;def
becomes
;;;test;abc;def
I tried different sorts of sed commands without any success.
for...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.