General :: Parse File From Remote Server To Caculate Count Of String Existence In That File?
Aug 30, 2010
I need to parse the file of same name which exist on different servers and calculate the count of string existed in both files.Say a file abc.log exist on 2 servers.I want to search for string "test" on both files and calculate the total count of search string's existence.For example if file abc.log on server 1 has string "test" 2 times
and file abc.log on server 2 has string "test" 4 times.then the output will beStringName : Countexampletest : 6 timesNote : I have created the password less connectivity using ssh-keygen.
View 2 Replies
ADVERTISEMENT
Jul 26, 2010
I need to read a file and parse a string. I know in Perl there is the split command. Is there something similar to that in C++?
View 6 Replies
View Related
Oct 22, 2010
copy string a to string b and change string b with toupper() and count the chars
View 3 Replies
View Related
Jun 27, 2011
I have a cron job running to act upon files if they exist in a folder... the problem is the nature of those new files. New files aren't put there very often, the server isn't used much (most of the time) so I would like to not check every minute to see if a new file is there and allow the disks to spin down and go to sleep. However, when a new file does exist there, it needs to be acted upon ASAP.
So currently I'm handling that with a cron job... it works... but what would work much better is the ability to act upon the event of a new file being present. Is there a way to trigger action upon new file system activity in a certain path? or just keep doing what I'm doing and have the system check all the time and keep the disks awake just in case something shows up?
View 9 Replies
View Related
Jun 15, 2010
I would like to know how I can replace a string in one file with the complete contents of another life.
View 10 Replies
View Related
Apr 2, 2011
I have a file ( /tmp/my_file.txt) in local server , I have a script as below , it works fine.
for file in /tmp/my_file.txt ; do
done
Now , if the file ( /tmp/my_file.txt ) is in remote server , can advise what can i do ?
View 3 Replies
View Related
Apr 26, 2011
I need to parse through a file which contains timestamps of transactions. What I am trying to do is come up with a Max Transactions Per Second (TPS) value. I was thinking that creating an array variable would be the way to go, but I'm having problems determining even how to start.
View 4 Replies
View Related
Oct 15, 2010
I have an situation where I want to read a file into my script that lie on a remote server. I have ssh-keys set up just don't know how to do this.
View 7 Replies
View Related
Nov 8, 2009
I have to create a bash script that takes an arbitrary length number from the command line, and add up each individual digit
Ex:
server> myscript.sh 123
server> 1 + 2 + 3 = 6
The problem I'm having is pulling out each character.
Is there a way in bash I can parse the input string for each character? I can't figure out a way to do this.
View 4 Replies
View Related
Apr 5, 2010
I am working on the script to parsing the specific message like "aaaa" in multiple log files like N1-***,N2-***,N3-***..The script is to find the list of lof files which contains the message "aaaa" and export the list into excel filE.
View 4 Replies
View Related
Sep 24, 2010
I am attempting to grep the contents of a key file I have SCP'd to a remote server. I am able to cat it:
Code:
[bluethundr@LBSD2:~]$:ssh root@sum1 cat /root/id_rsa.pub
root@lcent01.summitnjhome.com's password:
[code]...
View 5 Replies
View Related
May 4, 2010
I want linux command to parse a particular string or pattern in files that are in my home directory and its sub-directory.
View 4 Replies
View Related
Mar 26, 2010
Anybody know and command to count any characters in file? I would like to know the total number of character " (quote) in file. My idea is to check if in a script the total number of this character is pair.
View 4 Replies
View Related
Mar 6, 2010
in a tab-delimited file, such as:
Code:
111aIab
222bIIbc
[code]...
View 3 Replies
View Related
Apr 29, 2011
Go to a specified directory and open a log file and parse out specific information and dump it into another text file.
View 4 Replies
View Related
Apr 27, 2011
I want to write a bash script to parse a text file with the following lines and set variables for each line so that I can use them in the rest of the script.
Timestamp=123456789
Company=ABC Company
Server=Server
Recipient=Joe Smith
Email=joe@abc.com
simplest way to read each line one at a time for everything before the =, set that to a variable name with the value equal to everything after the =
View 14 Replies
View Related
Jul 18, 2010
delete a file on a remote server using shell scripting.
View 14 Replies
View Related
Feb 5, 2010
I am using below script to ftp a file to remote machine
Code:
#!/bin/bash
ftp -nv <<EOF
open ${SERVER}
[code]....
When I execute the above file its working fine and displaying output on to the screen. How can I log the output to a file?
View 7 Replies
View Related
Mar 30, 2011
Is this the correct way to show the line count of a specific file?
cat file | grep * -c
View 3 Replies
View Related
Sep 28, 2011
I am trying to parse a line from a file and place the values into separate variables:
input.txt:
Code:
CreateVegaFeed-20110928-before-skip-start
this is the code i have done so far:
Code:
$input_file="input.txt"
INPUT_FILE=`cat $input_file`
for i in $INPUT_FILE
[Code].....
View 14 Replies
View Related
Dec 23, 2010
I have a log file that contains information like this:
----------------------------
r11141 | prasath-palani | 2010-12-23 16:21:24 +0530 (Thu, 23 Dec 2010) | 1 line
Changed paths:
M /projects/
M /projects/
[code]....
what i need is, i need to copy the data given between the "---" to seperate files, for, e.g. the first set of data between the "---" should be in one file and another set of data in another file.
View 5 Replies
View Related
Feb 23, 2010
This should be simple but I can't seem to find what I am looking for.I want to search a text file for the existence of certain strings and execute a command if they exist, something along the lines of:
if <string> exists
command
or
if <any member of this list exists>
command
I know how to manually search a file with grep, cat, etc., but the "if this exists" part eludes me.
View 7 Replies
View Related
Sep 7, 2010
My shell script is calculating the count of each shortcode series wise whose sample output is as follows:
Code:
56882
9124 1
9172 1
9173 4
[code]....
View 1 Replies
View Related
Sep 21, 2009
I have a utility that works with files. The utility is crashing at after about 120 files. The input to the utility is a file containing a filelist. I want to cut the file with the file names in it to seperate files containing about one hundred or so. My thought was to determine the number of lines/100 and then use head and delete to create temporary files to run the utility multiple times to prevent the crash. When I tried to create a variable using the wc -l command the output gives me the number of total lines but it also includes the filename of the input file. (873 Filename.txt) I can not figure out how to remove the Filename.txt from the variable.
View 2 Replies
View Related
Feb 1, 2011
i need to count the number of files and put the output into a variable. i used wc -l filename but i couldnt find an option to put the output to variable. example if the number o line is 5, i need the output of echo $x is 5.
View 3 Replies
View Related
Jun 5, 2009
I have a text file which include code...
I mean, this string should be removed from each line and save in another file.
View 9 Replies
View Related
Apr 15, 2011
How to parse the bunch of values displayed by the socket program into the php file so that further it can be displayed in HTML page
View 1 Replies
View Related
Sep 3, 2010
I am trying to grep a particular string from the files of 2 different servers without copying and calculate the total count of its occurence on both files. File structure is same on both servers and for reference as follows:
Code:
27-Aug-2010 10:04:30,601|919122874903|phtunes_app|1282243292627|NotifySmsReception|DMGenerateLogInterceptor - ExternalTransactionID:SDP-DM-26713018, TransactionStatus:Requested
27-Aug-2010
[code]....
View 6 Replies
View Related
Oct 14, 2010
I want to be able to check the contents of a text file for a specific string and remove it from the file from the command prompt. I would basically be searching through a number of files and if a specific string is found I would like it removed automatically. pretty much a find and replace, were the replace is nothing. any one got any ideas on how you would do this. I already have the search part sorted just need to be able to remove the string I don't want from the multiple files.
View 4 Replies
View Related
May 1, 2011
My script.
This is may script:
Code:
Problem: Output file doest not exclude the values in grep -av
View 3 Replies
View Related