Search Results

Search: Posts Made By: dragon.1431
1,559
Posted By dragon.1431
minor correction: sed -e...
minor correction:
sed -e 's/"\(.*\),\(.*\)"/\1::\2/g' myfile
1,673
Posted By dragon.1431
Search & replace fields from file1 to file2
hi,

I have two xml files with the name source.xml and tobe_replaced.xml.

Sample data:
source.xml contains:
<?xml version="1.0"?>
<product description="prod1" product_info="some/info">...
4,261
Posted By dragon.1431
hi, just curious , echo...
hi,
just curious ,
echo "samplefile1.f0633.bin" | sed 's/.*\.[a-z]*\([0-9][0-9]*\)\.[bin|cmp|enc]/\1/'output :
0633ini couldn't find the reason why i didn't get 0633 :(
2,522
Posted By dragon.1431
hi, may i make small change? expected...
hi,

may i make small change?

expected output:
CREATE TABLE (COL1 DATATYPE1 NULL,COL2 DATATYPE2 NOT NULL,COL3 DATATYPE3 ....COL N DATA TYPEN NOT NULL);

s="CREATE TABLE (" t " "$0
instead of...
4,694
Posted By dragon.1431
hi, did you try this one sed 's/^M$//'...
hi,

did you try this one
sed 's/^M$//' input_file > output_file

NOTE: Use the "correct" "^M" to get it:
"control+v" followed by "control+m" key combinations.

in vi editor you can do this: ...
4,694
Posted By dragon.1431
@big123456: refer this thread: ...
@big123456:
refer this thread:
https://www.unix.com/shell-programming-scripting/28780-trying-remove-m-characters-file.html ...
8,871
Posted By dragon.1431
hi, thanks franklin for all your inputs. ...
hi,

thanks franklin for all your inputs. mkdir -p didnt work as expected on friday :( ( may be incorrect path).
8,871
Posted By dragon.1431
Hi, with that if condiition i can check the...
Hi,
with that if condiition i can check the presence of folder .Is there any way to reduce the dir depth one by one level and create dir for those if it is not present till
/home/guest/source/Dest...
8,871
Posted By dragon.1431
Hi Franklin, below one creates a dir "Dest"...
Hi Franklin,
below one creates a dir "Dest" which is not required.

mkdir -p ${Dest}
Expected output was to paste a file from /home/guest/source/xyz/Test/testsrc.c to...
8,871
Posted By dragon.1431
hi, echo command works as expected but not...
hi,

echo command works as expected but not cp.
seems problem with creation of folder .
i created test-script file and tried to copy to Dest dir and it worked. However it didnt work for other...
8,871
Posted By dragon.1431
hi, manually means copy paste in nautilus or...
hi,
manually means copy paste in nautilus or below one

$ cp /home/guest/source/xyz/Test/testsrc.c /home/guest/source/Dest/
$ ls /home/guest/source/Dest/
testsrc.cboth works .

i wanted to...
7,937
Posted By dragon.1431
IMHO, it should work as you expected. $...
IMHO, it should work as you expected.


$ cat infile
159,93848,5354,343,67898,45,677,5443,434,5545,45
677,45545,3522,244,
554,54344,3342,456,
344,43443,2344,444,23477...
8,871
Posted By dragon.1431
Hi Franklin, Thanks a lot for your solutions. ...
Hi Franklin,
Thanks a lot for your solutions.

it didn't work !!

#!/bin/bash
Source="/home/guest/source/"
Dest="/home/guest/source/Dest/"
tr ' ' '\n' < ${Source}input | while read file
do
...
7,937
Posted By dragon.1431
i think it is because of blank lines . try like...
i think it is because of blank lines .
try like this if u can delete blank lines before processing the data.

sed '/^$/d' infile | awk -F\, '{if($5==""){$5=99999};print $1,$2,$3,$4,$5}'
8,871
Posted By dragon.1431
What are the full names of the source and...
What are the full names of the source and destination directories?

I gave source & destination directory paths as follows:
/home/guest/source
/home/guest/source/Destunder source i have ...
2,533
Posted By dragon.1431
something like this: run.sh #!/bin/bash...
something like this:

run.sh

#!/bin/bash
sed -e "s/^>>>*/$1/" $2

run as:
run.sh hellohello infile
8,871
Posted By dragon.1431
hi, I apologize if i was not clear. source...
hi,
I apologize if i was not clear.

source and destination dir paths :

/home/guest/source
/home/guest/source/Dest
8,871
Posted By dragon.1431
hi, working one (not expected result) ...
hi,

working one (not expected result)
while read file; do dest=Dest; cp "$file" "$dest"; done < input
Input contains:
xyz/Test/testsrc.c
xyz/nmake/build.mak
abc/1.c


im confused why it...
8,871
Posted By dragon.1431
yes it is :cool:
yes it is :cool:
8,871
Posted By dragon.1431
hi, it didnt work . ls source && cat...
hi,

it didnt work .

ls source && cat source/input
abc Dest input xyz
/xyz/Test/testsrc.c
/xyz/nmake/build.mak
/abc/1.c


code:
while read file; do dest=/Dest${file}; cp "$file"...
8,871
Posted By dragon.1431
Copy files from input file with dir structure
hi,

I want to copy files from source directory based on input file (or output of previous command) and i want to have the SAME DIRECTORY STRUCTURE.
Note that i will have other files and...
14,694
Posted By dragon.1431
try this: a=00123.25 b=-00256.54 ...
try this:

a=00123.25
b=-00256.54
c=00489.23



echo " $a + $b + $c " | bc
355.94
2,107
Posted By dragon.1431
hi, try this: find . -type f -exec grep...
hi,
try this:
find . -type f -exec grep "Path" {} \;


i got output as follows:
Path=/home/user1/Pictures/Webcam/2010-06-14-203606.jpg...
1,408
Posted By dragon.1431
hi, something like this: echo...
hi,
something like this:
echo "c:/test/sample/" | sed -e 's/\//\\/g'

or
var_conversion=`"$var_SearchFile" | sed -e 's/\//\\/g'`
1,894
Posted By dragon.1431
hi, Anbu code works as expected and redirection...
hi,
Anbu code works as expected and redirection also works fine.

To get output in variable:

a=`sed "s/.*/'&'/" 1_ip | tr '\n' ',' | sed "s/,$//"`
echo $a
Showing results 1 to 25 of 60

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