Search Results

Search: Posts Made By: mirfan
2,275
Posted By mirfan
pattern matching problem
Thanks for the replies.
But sometimes To field contains email addresses in multiple lines. but following listed commands printing only 1st line. e.g.


To: test@example.com, test1@example.com,
...
2,275
Posted By mirfan
pattern matching problem
[root@linux~]# cat email.txt | grep -i "To:"
To: <test@example.com>

[root@linux~]# cat email.txt | grep -i "Subject"
Subject: Test
Subject: How are you.

I need to print only test@example.com...
32,770
Posted By mirfan
Hello, I tried this awk -vORS="" '1'...
Hello,

I tried this

awk -vORS="" '1' file

but this converting entire lines into single line. I need to do it for only test tables.

inputfile

INSERT INTO test (column1,column2) VALUES...
32,770
Posted By mirfan
hello, thanks for your reply i will check...
hello,

thanks for your reply i will check it. Can you please explain this command.

awk -vORS="" '1' file
32,770
Posted By mirfan
sed/awk remove newline
Hi,

I have input file contains sql queries i need to eliminate newlines from it.
when i open it vi text editor and runs


:%s/'\n/'/g


it provides required result. but when i run sed...
8,404
Posted By mirfan
shell script: grep multiple lines after pattern match
I have sql file containing lot of queries on different database table. I have to filter specific table queries.
Let say i need all queries of test1,test2,test3 along with four lines above it and sql...
5,064
Posted By mirfan
Hello, Franklin, i tried your command ...
Hello,

Franklin, i tried your command

awk -F, '/INSERT INTO test2/ {$((NF+5)/2)="\\n" $((NF+5)/2)}1' OFS="," inputfile

It outputs perfectly as "\ncolumn3value" but i forgot to mention that...
5,064
Posted By mirfan
Shell script: substitute value in text file
Hi gurus,

I need help with shell script. I have various INSERT queries which inserts data into database. I want to insert 3rd column data into newline for one particular table. I have very time...
3,870
Posted By mirfan
Shell script text file manipulation.
Hello,

I have mysql binary file which logs all the database queries and i to insert all queries log in to database. First i coverted binary file to text file. and start playing with it. Text file...
8,223
Posted By mirfan
Great. All of the solutions worked for me. Now...
Great. All of the solutions worked for me.
Now finally i had some table data as follows in input file.

SET INSERT_ID=1;
INSERT INTO table1 (column1,column2..column34) VALUES...
8,223
Posted By mirfan
Hi, Thanks great. second solution for me. ...
Hi,

Thanks great. second solution for me.
Thanks for the help

Thank you.
8,223
Posted By mirfan
Hello, Both of the solution(ygemici &...
Hello,

Both of the solution(ygemici & Franklin52) works for simple queries metioned earlier.
But i have very long queries sql file contains 1000 of database queries. e.g.

cat sourcefile.sql
...
8,223
Posted By mirfan
Hello, None of the commands work for me....
Hello,

None of the commands work for me. Anyways when i run following on commandline gives me error. Please let me know how to execute this


sed -e 's/VALUES (/VALUES (4255889,/' "INSERT INTO...
8,223
Posted By mirfan
sed string manipulation in shell script
Hello,

I have 1000 of sql queries and i need to push column value in query. e.g.

SET INSERT_ID=1
INSERT INTO test (id,name) VALUES ('a');
SET INSERT_ID=2
INSERT INTO test (id,name) VALUES...
9,369
Posted By mirfan
Shell Script to convert multilines to single lines
Hi,

I need to create an script which reads multi lines and convert it to single line or enter escape sequence at end "\".
e.g.

#!/bin/sh

echo -e "provide me query to run"
read query
...
20,056
Posted By mirfan
hello, Thanks for your reply. The first...
hello,

Thanks for your reply. The first command you mentioned works for me. e.g.

ssh source-ip "cd /home/dir1/html; zip /home/backup.zip dir2/test.php dir3/dir4/test2.php...
20,056
Posted By mirfan
Hello, Thanks for your reply. Unfortunately...
Hello,

Thanks for your reply. Unfortunately the command you gave me didn't worked for me. Let me explain you

Source Machine From Where I need to archive files:

cd /home/user/files

ls -la...
20,056
Posted By mirfan
how to remove absolute paths from zip archive
Hi,

I need to write an bash script which works like it can copy files from remote machine through ssh to the server where script is running in zip format with the structure i want. I don't want to...
9,471
Posted By mirfan
shell script pattern matching
Thanks for the reply. There is minor misktake in script i already sorted out. Now i have some other problem. which i am saving sql query result in variable. Let say

yahoo=$echo('select yahoo from...
9,471
Posted By mirfan
shell script pattern matching
Hi,
I need to create a shell script through which i need to populate email addresses in email columns of database table in mysql. Let say if email contains yahoo, hotmail, gtalk than email...
3,702
Posted By mirfan
Bash Script to Read & Write on different directories
Hi,

root@server] df -h

121G 14G 101G 12% /home
147G 126G 14G 91% /backup

We having our site files and images are storing in

/backup/home/user/files/ through symbolic link...
8,127
Posted By mirfan
Thanks for suggestion yongitz. I also first...
Thanks for suggestion yongitz.

I also first decided to go with rsync. But one of senior collegue having trouble with that in past. Because our image server has thousands of listing in image...
8,127
Posted By mirfan
Thanks for your reply you. Well this...
Thanks for your reply you.

Well this solution comes to my mind but again the problem i have around 10 subdirectories beneath in images directory. So this is little bit difficult to manage this....
8,127
Posted By mirfan
Yogesh, On image server files are stored in...
Yogesh,

On image server files are stored in random order. These are user images which are saved by our paid clients through website. For example

root@linux/root/images} ls -la...
8,127
Posted By mirfan
Yogesh, Thanks for your reply. we don't...
Yogesh,

Thanks for your reply. we don't want to use rsync. It is much havier. Can u please let me know how to record names of deleted files in a text file ?

Regards,
Muhammad Irfan
Showing results 1 to 25 of 26

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