Home > database >  How to remove the Spaces in the shell script exported TXT documents
How to remove the Spaces in the shell script exported TXT documents

Time:09-27

as title
Here a few questions, everyone a great god see, have a solution doesn't


The exported statement
Db2 "EXPORT TO ${_pathaddss}/IACI. TXT of DEL select TABLENAME, CLAIMSEQUENCENO, CONFIRMSEQUENCENO, RECOVERYCODE from ZBTABLE_PK"


Below is the data in a TXT:
"A", "50 picc370015001439865885172131", ""," "
"B", "50 picc370015001439865885172131", "02 picc370015001439865115632111", ""
"C", "50 picc370015001439865885172131", "02 picc370015001439865115632111", ""
"D", "50 picc370015001439865885172131", ""," "
"E", "50 picc370015001439865885172131", ""," "
"F", "50 picc370015001439865885172131", ""," "
"D", "50 picc370015001439865885172131", ""," "




Data and repeated
Script statements:
Eecho 'set the schedule of nuclear damage of vehicle accessories'
_DINGCHEMINGNO=` db2 - x "select ClaimQueryNo from IALVEHICLEFITTING where ClaimQueryNo='${j}" `

Db2 "insert into ZBTABLE_PK values (' IALVEHICLEFITTING ', '${_DINGCHEMINGNO}', ', ')"
Db2 "insert into ZBTABLE_PK values (' IALVEHICLEFITTINGHis', '${_DINGCHEMINGNO}', ', ')"

The exported TXT data:

"IALVEHICLEFITTING", "50 picc370018001516156153150100 picc370018001516156153150100 50", ""," "


Wish a great god under the guidance

CodePudding user response:

Method 1: in the Select statement field before adding trim (field), remove the blank space; Using distinct fields, duplication,
Method 2: use of UE or rich text editor such as notepad + + processing text, use quotes after matching Spaces + replace to remove Spaces; Use the edit & gt; Line operations & gt; Sorting, duplication,
Individual menu editor, name is the same, specific tools to baidu, here to provide a train of thought,

CodePudding user response:

Export IACI. TXT, cat IACI. TXT | sed -e "s///g & gt;" IACI_1. TXT, IACI. TXT is source file, IACI_1. TXT is to redirect the file after the empty, cat that directly behind the db2 export statements that, put in the shell, perform together
  •  Tags:  
  • DB2
  • Related