0

I am using JREPL (which is a very fast tool by the way) to search through a large CSV file and then replace some text in the file. However I ma running into a problem, whereby I only want to replace the values in the very first column of my file, not all columns

Here is the code that works:

type "DataminerFile.csv" | jrepl "01" "10" | jrepl "02" "20" | jrepl "03" "30" | jrepl "04" "40" > output.csv

I have tried this snippet in all the replacements, but it errors.

jrepl "02^{A1}"

Here is the structure of the CSV file

"01","GL","GENERAL LEDGER","*",88888,"MD/FI COMMENT ?"
"01","CONT01","CONTINENTAL NH3 PRODUCTS","A-BVT-RK",4,"REPAIR KIT FOR"
"03","CONT01","CONTINENTAL NH3 PRODUCTS","A-BVT-RK",1,"REPAIR KIT FOR"

So in column one, if the value is "01" I want to replace this to "10" but not touch column two.

dbenham
  • 127,446
  • 28
  • 251
  • 390
Matthew Colley
  • 10,816
  • 9
  • 43
  • 63
  • 2
    The [person](https://stackoverflow.com/users/1012053/dbenham) who developed [JREPL](https://www.dostips.com/forum/viewtopic.php?f=3&t=6044#p37967), @dbenham, is also a member of this forum. Whilst I'm sure there are many here who have read his extensive usage information and understood it, you may be lucky enough that he provides the most succinct answer for you. Please make sure that you've fully read the usage information though, _I'm sure I'd be upset at having written it all and find that end users cannot be bothered to read it!_ – Compo Mar 09 '18 at 16:27
  • 1
    `JREPL` is maintained by the Developer on the DosTips.com forum. Why wouldn't you post your question there? – Squashman Mar 09 '18 at 16:31
  • @squashman - perhaps I did not know that he is developer over there?? – Matthew Colley Mar 09 '18 at 16:37
  • 1
    @MatthewColley, where did you get `JREPL` from then? The help file inside JREPL literally says this: **JREPL.BAT version 7.9 was written by Dave Benham, and originally posted at http://www.dostips.com/forum/viewtopic.php?f=3&t=6044** – Squashman Mar 09 '18 at 16:55
  • Seriously Does it now matter?? I answered my own question, I fixed the problem, move the f**k on and let it go. Too bad we cant put people like you on ignore – Matthew Colley Mar 09 '18 at 16:59
  • @MatthewColley, there was absolutely no excuse for rudeness, please delete the comment above, and I will in turn remove this one. – Compo Mar 09 '18 at 17:17
  • 1
    Literally trying to help you get the proper help you need. You can lead a horse to water but you can't make them drink. – Squashman Mar 09 '18 at 17:29

1 Answers1

0

If anyone stumbles across this from Google or whatever the hell we call it in the future (great brain hive??) Here is what fixed my problem. I enclosed my search parameters in a \b

type "DataminerFile.csv" | jrepl "\b01\b" "10" | jrepl "\b02\b" "20" | jrepl "\b03\b" "30" | jrepl "\b04\b" "40" > output.csv
Matthew Colley
  • 10,816
  • 9
  • 43
  • 63