10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i am having file like this
#!/bin/bash
read -p 'Username: ' uservar
match='<color="red" />'
text='this is only a test
so please be patient
<color="red" />'
echo "$text" | sed "s/$match/&$uservar\g"
so desireble output what i want is if user type MARIA
this is only a test
so please... (13 Replies)
Discussion started by: tomislav91
13 Replies
2. UNIX for Beginners Questions & Answers
Dears, I have string like below in my csv file
<someTechnicalDetails><someTechnicalDetails>HSI</someTechnicalDetails,1234564
<someTechnicalDetails><someTechnicalDetails>Voice</someTechnicalDeta,12345673
<someTechnicalDetails><someTechnicalDetails>IPTV</someTechnicalDetai,12345673
and I... (2 Replies)
Discussion started by: mirwasim
2 Replies
3. Shell Programming and Scripting
I need to read a text file and insert a string every n lines, but also have the line counter restart when I come across a header string.
Line repeating working every 3 lines using code:
sed '0~3 s/$/\nINSERT/g' < INPUT/PATH/FILE_NAME.txt > OUTPUT/PATH/FILE_NAME.txt
I cannot seem to find... (1 Reply)
Discussion started by: Skonectthedots
1 Replies
4. Shell Programming and Scripting
Hi All,
How to fetch the particular row based on my search command. For example
Source Column
Column A Column B
001,56123456
002,57123456
003,123456
Expected Output:
003,123456
To get this output I tried below mentioned function
grep '123456' filename.txt (4 Replies)
Discussion started by: suresh_target
4 Replies
5. Shell Programming and Scripting
I need to insert a comment string to a couple of fields for every line in the file. Different comment string for each field.
In below file, fields 7 and 8
"R","1","t0000684","","10/31/2013","10/31/2013","","","","750.23"... (6 Replies)
Discussion started by: Melah Gindi
6 Replies
6. Shell Programming and Scripting
I have a file with some SQL query, I want to fetch only Table Name from that file line by line.
INPUT FILE
SELECT * FROM $SCHM.TABLENAME1;
ALTER TABLE $SCHM.TABLENAME1 ADD DateOfBirth date;
INSERT INTO $SCHM.TABLENAME1 (CustomerName, Country) SELECT SupplierName, Country FROM $SCHM.TABLENAME2... (2 Replies)
Discussion started by: Pratik Majithia
2 Replies
7. Shell Programming and Scripting
Hi
I am having a file with content as,
<name>usrname</name> <value>ravistej</value>
<name>pswd</name> <value>asdfgzxcv</value>
.
.
.
.
<name>abc</name> <value>xyz</value>
From this file,
i want to fetch the string present between '<value>' and '</value>' and store the values into... (9 Replies)
Discussion started by: tejastrikez
9 Replies
8. Shell Programming and Scripting
Hi
I am trying to fetch the rows with match string "0000001234"
Input file looks like below:
09 0 XXX 0000001234 Z 1
09 0 XXX 0000001234 Z 1
09 0 XXX 0000001234 Z 1
09 0 XXX 0000001234 Z 1
09 0 XXX 0000001234 Z 1... (6 Replies)
Discussion started by: nareshk
6 Replies
9. Shell Programming and Scripting
Hi,
I am trying to execute this command
if ; then
but getting error .Some problem with reteriving the value of $exception_info.
Please help.Its urgent.
thanks (4 Replies)
Discussion started by: khushboo
4 Replies
10. Programming
How do I correct this vector<string> insert.
I am geeting segmintation dump.
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <iostream>
//#include <sstream>
#include <string>
#include <utility>
#include <vector>
using... (1 Reply)
Discussion started by: photon
1 Replies