Python Forum
Creating a delimited file from DB Table
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating a delimited file from DB Table
#4
The file path is the source of your problem - C:\location\output.dat. Backslash is an escape symbol, giving a special meaning to to following character, e.g. \n.

Either prefix the path with r to make it a raw string - r'C:\location\output.dat', or use double backslash. Replacing backslash with a slash will work too.

PS IDLE is one of the worst Python environments, I would recommend switching to Spyder or Jupyter
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Messages In This Thread
RE: Creating a delimited file from DB Table - by volcano63 - Sep-15-2018, 02:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Tab Delimited Strings? johnywhy 7 783 Jan-13-2024, 10:34 PM
Last Post: sgrey
  Help creating shell scrip for python file marciokoko 10 1,625 Sep-16-2023, 09:46 PM
Last Post: snippsat
  Creating csv files from Excel file azizrasul 40 6,485 Nov-03-2022, 08:33 PM
Last Post: azizrasul
  Use module docx to get text from a file with a table Pedroski55 8 6,784 Aug-30-2022, 10:52 PM
Last Post: Pedroski55
  Converted Pipe Delimited text file to CSV file atomxkai 4 7,316 Feb-11-2022, 12:38 AM
Last Post: atomxkai
  Creating file with images BobSmoss 1 1,462 Jan-08-2022, 08:46 PM
Last Post: snippsat
  dataframe write to tab delimited differs from Excel koh 0 2,081 Aug-01-2021, 02:46 AM
Last Post: koh
  Yahoo_fin, Pandas: how to convert data table structure in csv file detlefschmitt 14 8,117 Feb-15-2021, 12:58 PM
Last Post: detlefschmitt
  write mariadb table rows query to each file? shams 1 2,009 Feb-02-2021, 04:10 PM
Last Post: buran
  Creating csv file from another file pisike 0 1,659 Nov-24-2020, 02:02 PM
Last Post: pisike

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020