Excution Problems with loading huge data content and convert it


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Excution Problems with loading huge data content and convert it
# 15  
Old 10-14-2010
hi rdcwayx,
Why it seems like both of the below command is not working properly?
Code:
for i in $(cat reference.txt)
do
  sed -i "s/$i/XXXXXXXXXXXXXXX/g" input      # if your sed don't support -i option, replace by below perl command
# or
  perl -i -pe  "s/$i/XXXXXXXXXXXXXXX/g" input 
done

Is it I missed anything?
Thanks for advice ya ^^

---------- Post updated at 11:39 PM ---------- Previous update was at 11:14 PM ----------

hi rdcwayx,
I just wondering whether we can write the result into another new file by using your script below?
Code:
for i in $(cat reference.txt)
do
  sed -i "s/$i/XXXXXXXXXXXXXXX/g" input      # if your sed don't support -i option, replace by below perl command
# or
  perl -i -pe  "s/$i/XXXXXXXXXXXXXXX/g" input > input.out (I got try this. But it is not worked :( )
done

Thanks for advice ya ^^

---------- Post updated 10-14-10 at 12:00 AM ---------- Previous update was 10-13-10 at 11:39 PM ----------

I just found out that the command below:
Code:
awk '
NR==FNR {t=$0;gsub(/./,"x");a[t]=$0;next}
{
        for (i in a) if ($0~i) sub(i,a[i])
}1
' referral.data input.data

seem like missed to replace some of the referral data content in input data Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Aggregation of huge data

Hi Friends, I have a file with sample amount data as follows: -89990.3456 8788798.990000128 55109787.20 -12455558989.90876 I need to exclude the '-' symbol in order to treat all values as an absolute one and then I need to sum up.The record count is around 1 million. How... (8 Replies)
Discussion started by: Ravichander
8 Replies

2. Shell Programming and Scripting

Extract few content from a huge list of files

I have a huge list of files (about 300,000) which have a pattern like this. .I 1 .U 87049087 .S Am J Emerg .M Allied Health Personnel/*; Electric Countershock/*; .T Refibrillation managed by EMT-Ds: .P ARTICLE. .W Some patients converted from ventricular fibrillation to organized... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

3. Shell Programming and Scripting

File Content Loading to Oracle Error

I habe a UNIX Variablw with content as below: WHOLE_REC_TXT="$record" where $record contains contents of file Sample contents of file: topic_id|1624|AIDS-HIV|| topic_id|1625|Allergies|| topic_id|1626|Alzheimer s|| topic_id|1627|Knee Pain|| topic_id|1628|Autism||... (2 Replies)
Discussion started by: Arun Mishra
2 Replies

4. Shell Programming and Scripting

convert huge .xml file in .csv with specific column.

I have huge xml file in server and i want to convert it to .csv with specific column ... i have search in blog but i didn't get any usefully command. Thanks in advance (1 Reply)
Discussion started by: pareshkp
1 Replies

5. Programming

Loading Data in shared memory (C++)

I'll try to keep this short, but basically I need to figure out a way to load data in shared memory (this file will be called load.c) I will later access the data with a print.c program. The "data" is in the form of a student database that looks like this John Blakeman 111223333 560... (7 Replies)
Discussion started by: Mercfh
7 Replies

6. Shell Programming and Scripting

Execution Problems with scan and change file data content

Input file >Read_1 XXXXXXXXXXSDFXXXXXDS ASDRXXXXXTGAGTXXXXXT TGTGATXXXXXAXXXXGXXA . . Desired output file >Read_1 XXXXXXXXXXXXXXXXXXDS ASDRXXXXXTGAGTXXXXXT TGTGATXXXXXXXXXXXXXA . . (5 Replies)
Discussion started by: patrick87
5 Replies

7. UNIX for Advanced & Expert Users

creating data loading script

asdfasdfasdfasdf??? (2 Replies)
Discussion started by: noorm
2 Replies

8. UNIX for Dummies Questions & Answers

data is seen as NULL after loading into database

hello, when I load a data from text file all the values become NULL in the table. Please help me with this problem. Thanks sheen (15 Replies)
Discussion started by: sheen
15 Replies

9. Shell Programming and Scripting

Problem of Data Loading....

i am studying a script which is used for data loading. it has functions which deletes all the existing data before loading and then loads new fresh data. but i am stuck up at function Replace into table ( col 1,col 2....) Does this signify All Inserts. (1 Reply)
Discussion started by: ankitgupta
1 Replies

10. Linux

courier-authlib problems loading libmysqlclient.so.14 and libcourierauthcommon.so.0

I am having problems with mysql authentication using courier-authlib (authdaemond). This is getting really frustrating. The error I am getting is: Aug 28 17:48:48 www authdaemond: modules="authmysql", daemons=5 Aug 28 17:48:48 www authdaemond: Installing libauthmysql Aug 28 17:48:48 www... (0 Replies)
Discussion started by: msilvers
0 Replies
Login or Register to Ask a Question