Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python replace newline

from tika import parser

filename = 'myfile.pdf'

# Parse the PDF
parsedPDF = parser.from_file(filename)

# Extract the text content from the parsed PDF
pdf = parsedPDF["content"]

# Convert double newlines into single newlines
pdf = pdf.replace('

', '
')

#####################################
# Do something with the PDF
#####################################
print (pdf)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #replace #newline
ADD COMMENT
Topic
Name
8+5 =