where file_name has
/data/ds/dpr_ebicm_uat/backfill/temp/etl_app_info.csv
/data/ds/dpr_ebicm_uat/backfill/temp/etl_app_jobs.csv
/data/ds/dpr_ebicm_uat/backfill/temp/etl_ctrlmrmv_config.csv
/data/ds/dpr_ebicm_uat/backfill/temp/etl_filerename_config.csv
/data/ds/dpr_ebicm_uat/backfill/temp/etl_fileutil_config.csv
/data/ds/dpr_ebicm_uat/backfill/temp/etl_filewatcher_config.csv
/data/ds/dpr_ebicm_uat/backfill/temp/etl_formatter_config.csv
when i do
echo $table i get following value
/data/ds/dpr_ebicm_uat/backfill/temp/purge_table_config.csv
whereas i need only purge_table_config which refers to the table name.
But the same command gives me the correct output in unix. But now as our project is migrating we are using linux.
Could you all please help me to modify this command so that it gives the output as only purge_table_config which is only the table name.
gawk splits the line into fields when the line is read - resetting FS afterwards (i.e. inside a procedure) doesn't change the field splitting (which is correct POSIX, iirc).
You can either set FS inside BEGIN, or use -F.
e.g.
where VALUE=/data/ds/dpr_ebicm_uat/backfill/temp/etl_app_jobs.csv
I ran the command and it is giving me output as
0
0
0 likewise all zeros
I also need interpretation of following command
cat ${file_name} | awk 'NR>1' | while read data
value=`echo ${data} | awk '{if (substr($1,0,1) == "\047") gsub("^\047+|\047+$", "", $0); gsub("\047,\047"," ",$0); print}'`
i want to know what value will the value variable have.
where file_name contains the list of files mentioned earlier
/data/ds/dpr_ebicm_uat/backfill/temp/etl_app_info.csv
/data/ds/dpr_ebicm_uat/backfill/temp/etl_app_jobs.csv
/data/ds/dpr_ebicm_uat/backfill/temp/etl_ctrlmrmv_config.csv
/data/ds/dpr_ebicm_uat/backfill/temp/etl_filerename_config.csv
/data/ds/dpr_ebicm_uat/backfill/temp/etl_fileutil_config.csv
/data/ds/dpr_ebicm_uat/backfill/temp/etl_filewatcher_config.csv
/data/ds/dpr_ebicm_uat/backfill/temp/etl_formatter_config.csv
I have taken this directly from the script, when i tried running it on linux its throwing me following error
-bash: 0: command not found
I also tried running this command separately VALUE=`echo ${VALUE} | sed -e 's/"//g'` it again throws a error like
-bash: command not found. Do these commands have a separate syntax in linux.
Please help me out with this. As the script is working different in linux enviornment
I had just missed out the starting bracket, else thats the only command.
Ok then atlease can you tell me what the index variable does. And why is the sed command throwing an error.
---------- Post updated at 09:51 AM ---------- Previous update was at 09:48 AM ----------
I guess i had just missed out the starting bracket, else there's nothing before that. Atleast can you tell me what does the index field in the awk command does. And why is the sed command