pandoc "cannot parse yaml header" when converting md to pdf - pdf

I am trying to convert a markdown document to pdf using pandoc, and it was working fine until it just started to show an error:
pandoc: Could not parse YAML header: did not find expected alphabetic or numeric character "source" (line 32, column 85
pandoc: YAML header is not an object "source" (line 17, column 1)
pandoc: Could not parse YAML header: did not find expected alphabetic or numeric character "source" (line 8, column 91)
Lines 32 and 8 are blank lines between paragraphs, and all that's on line 17 is "---".
I don't even know what YAML is, but I don't want to use it, just MD->LaTeX->PDF.
Searched for these errors but could only find stuff mentioning YAML, not the errors.
Any help would be appreciated.

See http://johnmacfarlane.net/pandoc/README.html#yaml-metadata-block
There must be something in your document that looks like a YAML metadata block, but isn't.
Such a block would start with --- on a line by itself and end with --- or ... on a line by itself. The line numbers in the error message refer to lines inside the metadata block, not to lines of the document.
By the way, you can turn off YAML metadata block parsing entirely by putting
--from markdown-yaml_metadata_block
in your pandoc command line.

Related

Postgresql "+" symbol for carriage return / new line for zsh script

So I query that pulls text from a column called "description."
Each description contains a list like so:
1) Some text here
2) Some text here
3) Some text here
The problem is when I run the query in my zsh script the new lines return a "+" symbol instead of a carriage return.
1) Some text here + 2) Some text here + 3) Some text here...
The code is
tempdescriptionday4=$(/Applications/Postgres.app/Contents/Versions/12/bin/psql -h 1.1.1.1 -p5555 -U myuser mytable -t -c "SELECT description FROM cycle_10 WHERE air_date = 2020-11-10"
I'm trying to inject this list into an XML file for an RSS feed but I'm stuck on how to format this properly. I tried replacing the + symbol with 
 but that didn't work--I still am not getting a new line. Any ideas?
Found this in the postgresql12 manual — it's called:linestyle
"Sets the border line drawing style to one of ascii, old-ascii, or unicode. Unique abbreviates are allowed. (that would mean one letter is enough.) The default setting is ascii. This option only affects the aligned and wrapped output formats"
So for me since I have multiple lines in a cell it "wraps" the text at the end making it a wrapped output format.
"ascii style uses plain ASCII characters. Newlines in data are shown using a + symbol in the right-hand margin." When the wrapped format wraps data from one line to the next without a new line character, a dot"." is shown in in the right-hand margin of the first line, and again in the left-hand margin of the following line."
There's also "old-ascii" style that uses a ":" for wrapping and a "unicode" style which uses an ellipsis symbol in the right and margin of first line.
So the problem I have is that the output format is using ASCII by default when there's no available option for XML output style for new lines. Bummer.
Turning linestyle off fixes removing the + symbol but I want the outputted linestyle to be XML so if it strips any new line indication there's no way for me to format it. "-A --no-align Switches to unaligned output mode. (The default output mode is aligned.) This is equivalent to \pset format unaligned."
So I used awk to substitute the + symbol for 
 and also tried
but those are not creating new lines for me? It validates as proper XML.

Importing large CSV file into Postgres error unquoted carriage

I am trying to import a large csv file using COPY, but I keep getting this error code.
ERROR: unquoted carriage return found in data
HINT: Use quoted CSV field to represent carriage return.
CONTEXT: COPY nyc_yellow_taxi_trips_2018_01, line 2
SQL state: 22P04
I know it is due to the blank row right under the header, but I tried manually deleting the space by opening through TextEdit. I also tried opening through excel, the file is too big to edit, but after deleting the space through TextEdit, there was no blank space.
I am still getting this error. Most likely an easy fix but I have been on this for awhile now.
Here is my code:
COPY nyc_yellow_taxi_trips_2018_01
FROM '/Users/eddy/taxi/yellow_tripdata_2018-01.csv'
WITH (FORMAT CSV, header, Delimiter ',' );
It looks like you have inconsistent line endings. It has found a carriage return, but it expected (based on what ended the header line) either just a newline, or a CRNL.
You need to make the line endings consistent, which I don't know how to do using TextEdit.

Combine SQL files with command `copy` in a batch file introduce an incorrect syntaxe because it does add an invisible character `U+FEFF`

In a pre-build event, a batch file is executed to combine multiple SQL files into a single one.
It is done using this command :
COPY %#ProjectDir%\Migrations\*.sql %#ProjectDir%ContinuousDeployment\AllFilesMergedTogether.sql
Everything appear to work fine but somehow the result give an incorrect syntaxe error.
After two hours of investigation, it turn out the issue is caused by an invisible character that remain invisible even with notepad++.
Using an online website, the character has been spotted and is U+FEFF has shown in following image.
Here are the two input scripts.
PRINT 'Script1'
PRINT 'Script2'
Here is the output given by the copy command.
PRINT 'Script1'
PRINT 'Script2'
Additional info :
Batch file is encoded with UTF-8
Input files are encoded with UTF-8-BOM
Output file is encoded with UTF-8-BOM.
I'm not sure it is possible to change the encoding output of command copy.
I've tried and failed.
What should be done to eradicate this extremely frustrating parasitic character?
It has turned out that changing encoding of input files to ANSI does fix the issue.
No more pesky character(s).
Also, doing so does change the encoding of the result file to UTF-8 instead of UTF-8-BOM which is great I believe.
Encoding can be changed using Notepad++ as show in following picture.

Error while converting from getdate() function

On command line
convert(varchar,getdate(),120)
gives below error:
Unknown argument '04:59:42.xml'
I am saving data to an xml file.
when I use below command,proc works perfectly.
convert(varchar,getdate(),112)
I need the file to save with time.
You are trying to create a file with a colon in the name, which is not allowed. No way to get around that restriction. However, you can replace the colons with other characters when naming the file, e.g.
replace(convert(varchar,getdate(),120),':','')

Uncrustify Formatter error when code contains single hash characters

I am using the Uncrustify plugin for Xcode5 (BBUncrustifyPlugin) to format my code nicely. However when formatting the active file it gives the errors:
Uncrustify Formatter error:
Parsing: XDImageViewController.m as language OC
XDImageViewController.m:33 Unmatched NEWLINE
Looking at this line all I have is a single hash # followed by a new line. like so:
#
#pragma mark - Section header
#
Can anyone tell me if there is a way to get Uncrustify to ignore this error or work around it? I don't see why a hash should cause problems.
Thanks.