4 ms·
Yesterday I dumped a broken markdown table and asked for the first "column" as CSV values. Works really well for this stuff too.
by swah 4y ago
Yesterday I dumped a broken markdown table and asked for the first "column" as CSV values. Works really well for this stuff too.
- toomuchtodo 4y agoI love that it’s replacing sed, awk, and cut in the same way you’d bring artillery to a knife fight.
- mrbungie 4y agoI've seen some really f**ed up text formatted files in the wild. In those cases I really see value in using something more "intelligent" (and declarative rather than imperative) rather than coding a non-trivial number of [python|bash] lines of code, especially when dealing with one-timers.
- ogogmad 4y agoI think our operating systems are going to have this stuff installed one day. It might replace most uses of the CLI.
- croes 4y agoBut sed, awk etc.results are predictable and reproducible. That's not guaranteed with ChatGPT.
- femto113 4y agoYou could try asking it to output the sed/awx/etc. commands needed to do the desired transformation reproducibly. If it's not yet good at that it will be soon.
- bostonsre 4y agoIt is good at that and you can only paste so much data into the UI, so usually go this route for complex one liners.
- croes 4y agoThe question is if you can understand the solution if it's complex. Just like the regex for valid email addresses, it may be correct but it's hard to understand it. I see it more as a tool for doing the tedious but simple work, if it's getting complex you get a hard time checking the correctness of the result.
- justsomehnguy 4y agoCasual reminder what you shouldn't try to parse email addresses for a validity with regex, besides checking for '@' aaaaaaaand maybe for '@\w+?\.\w+?' if you are sure the code would only face the globally addressable addresses.
- Veen 4y agoI use it for similar stuff all the time. Yesterday I had a csv full of multi-word hashtags with no spaces between the words. I needed to split them all into separate words, add spaces, and remove the #. It would have been pain to write code to reliably add spaces, especially because many of the hashtags contained non-standard words and abbreviations, but GPT-4 handled it no problem. Saved me hours.
- robbiemitchell 4y agoSame! I had a directory of info coded horribly by some CRM into HTML DIVs (not a table) and copy/pasting it into a text file resulted in a single column of names, contact info, kids, grades, etc. I asked ChatGPT to reformat it into a CSV, noted the useful breaks, requested some transformations and filtering, and specified a delimiter. After 5 minutes of experimentation, it worked like a charm. Absolutely amazing.