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 !!!
...values).
Example
TableTest :
ID Value
1 test1
2 test2
3 test3
4 test4
begin tran
Update TableTest set Value = test0 where ID = 3
Select * from TableTest
I need the result (imediatly) from select to be :
ID Value
1 test1
2 test2
4 test4
Thank you !!
(Sybase...
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)...
...fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read);
If I run it on my machine (local), and try
to open a file
* c:\Project\MyFile.pdf
=> it works fine
* C:\Users\ME\Desktop\MyFile.pdf
=> access denied
If I run it from the web , I...
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 ...
...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 example sed -i "s/*/;;;*/g" myfile.csv > newfile.csv
I get the error "sed: illegal option --i"
Many...
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.