Ich versuche, in einer bestimmten Spalte einer Datei mit Hilfe von awk like this zu ersetzen. Ich kann es an der Arbeit des „r“ in der Spalte ersetzen 3Awk wird nicht in allen Spalten ersetzen
awk '{ sub(/r$/, "Q", $3) }1' temp2.txt
Oder die „4“ in Spalte 6 mit
awk '{ sub(/4$/, "Q", $6) }1' temp2.txt
jedoch verwendet wird, kann ich nicht auf der „T ersetzen tun "in der Spalte 4.
der Inhalt der Datei sind
cat temp2.txt
224245 CO2_Cells_50_V_-100_P_760 r 2016-08-18T13:35:12.337 [email protected] 4
224256 CO2_Cells_100_V_-200_P_760 r 2016-08-18T13:35:15.408 [email protected] 4
224261 CO2_Cells_100_V_-250_P_760 r 2016-08-18T13:35:16.425 [email protected] 4
224262 CO2_Cells_150_V_-250_P_760 r 2016-08-18T13:35:16.426 [email protected] 4
224264 CO2_Cells_250_V_-250_P_760 r 2016-08-18T13:35:17.438 [email protected] 4
224266 CO2_Cells_100_V_-300_P_760 r 2016-08-18T13:35:17.440 [email protected] 4
224267 CO2_Cells_150_V_-300_P_760 r 2016-08-18T13:35:17.442 [email protected] 4
224268 CO2_Cells_200_V_-300_P_760 r 2016-08-18T13:35:17.443 [email protected] 4
224269 CO2_Cells_250_V_-300_P_760 r 2016-08-18T13:35:18.460 [email protected] 4
224271 CO2_Cells_100_V_-350_P_760 r 2016-08-18T13:35:18.463 [email protected] 4
224272 CO2_Cells_150_V_-350_P_760 r 2016-08-18T13:35:18.464 [email protected] 4
224273 CO2_Cells_200_V_-350_P_760 r 2016-08-18T13:35:18.466 [email protected] 4
224274 CO2_Cells_250_V_-350_P_760 r 2016-08-18T13:35:19.539 [email protected] 4
224277 CO2_Cells_150_V_-400_P_760 r 2016-08-18T13:35:19.543 [email protected] 4
224278 CO2_Cells_200_V_-400_P_760 r 2016-08-18T13:35:19.545 [email protected] 4
224279 CO2_Cells_250_V_-400_P_760 r 2016-08-18T13:35:20.649 [email protected] 4
224282 CO2_Cells_150_V_-450_P_760 r 2016-08-18T13:35:20.653 [email protected] 4
224283 CO2_Cells_200_V_-450_P_760 r 2016-08-18T13:35:20.654 [email protected] 4
224287 CO2_Cells_150_V_-500_P_760 r 2016-08-18T13:35:21.718 [email protected] 4
224288 CO2_Cells_200_V_-500_P_760 r 2016-08-18T13:35:21.720 [email protected] 4
224289 CO2_Cells_250_V_-500_P_760 r 2016-08-18T13:35:21.721 [email protected] 4
224522 CO2_Cells_250_V_-450_P_760 r 2016-08-18T14:54:09.720 [email protected] 4
224699 CO2_Cells_50_V_-150_P_760 r 2016-08-18T18:04:18.900 [email protected]t062.crc.nd.edu 4
es keinen Nutzen von'/[[T]/'über nur'/T/'. –
Zustimmen, es war mehr für ein Beispiel, falls mehr als ein Zeichen ersetzt werden muss. –